package com.nce.entity;

public class MsgStats {
	private String qqid;
	private String qqgroup;
	private Long counts;
	private String username;
	private Vp vp;
	
	
	
	public Vp getVp() {
		return vp;
	}
	public void setVp(Vp vp) {
		this.vp = vp;
	}
	public String getQqid() {
		return qqid;
	}
	public void setQqid(String qqid) {
		this.qqid = qqid;
	}
	public String getQqgroup() {
		return qqgroup;
	}
	public void setQqgroup(String qqgroup) {
		this.qqgroup = qqgroup;
	}
	public Long getCounts() {
		return counts;
	}
	public void setCounts(Long counts) {
		this.counts = counts;
	}
	
	

	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}

	
	

	@Override
	public String toString() {
		return "MsgStats [counts=" + counts + ", qqgroup=" + qqgroup
				+ ", qqid=" + qqid + ", username=" + username + ", vp=" + vp
				+ ", getVp()=" + getVp() + "]";
	}
	public String formatToCsv(int i) {
		StringBuffer sb = new StringBuffer();
		sb.append(i).append(",");
		sb.append("\"").append(qqid).append("\",");
		sb.append(counts).append(",");
		sb.append("\"").append(username).append("\",");
		sb.append("\"").append(qqgroup).append("\",");
		if(vp!=null){
			sb.append("\"").append(vp.getUsername()).append("\",");
		}
		if(vp!=null){
			sb.append("\"").append(vp.getAddress()).append("\",");
		}
		sb.append("\r\n");
		return sb.toString();
	}
	public static String formatToCsvHeader() {		
		return "序号,QQ号,记录数,昵称,所在群,姓名,地址\r\n";
	}
	
	

}
